using UnityEngine;
using UnityEngine.SceneManagement;

public class MainStarterPacksUI : MonoBehaviour
{
	private static MainStarterPacksUI _instance;

	public StarterPackUI starterPackUI;

	public static MainStarterPacksUI instance
	{
		get
		{
			if (_instance == null)
			{
				_instance = ((GameObject)Object.Instantiate(Resources.Load("MainStarterPacksUI"))).GetComponent<MainStarterPacksUI>();
				if (SceneManager.GetActiveScene().name == "Lobby" && MarketControllerUI.instance != null && MarketControllerUI.instance.gameObject.activeSelf)
				{
					_instance.transform.SetParent(MarketControllerUI.instance.transform);
				}
				else if (MarketControllerUI.instance != null && MarketControllerUI.instance.gameObject.activeSelf)
				{
					_instance.transform.SetParent(MarketControllerUI.instance.transform);
				}
				else if (GameUI.instance != null)
				{
					_instance.transform.SetParent(GameUI.instance.transform);
				}
				_instance.transform.localPosition = Vector3.zero;
				_instance.transform.localScale = Vector3.one;
			}
			return _instance;
		}
	}

	private void Awake()
	{
		_instance = this;
	}

	public void ShowStarterPackUI(StarterPack starterPack)
	{
		starterPackUI.Show(starterPack);
	}

	public void HideStarterPackUI()
	{
		starterPackUI.Hide();
	}
}
